<!-- 
Copyright (c) 2021-2024 SigScalr, Inc.

This file is part of SigLens Observability Solution

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->

<!DOCTYPE html>
<html lang="en">
<script async src="https://www.googletagmanager.com/gtag/js?id=G-5SBJC04YFB"></script>
<script>
    window.dataLayer = window.dataLayer || [];
    function gtag() { dataLayer.push(arguments); }
    gtag('js', new Date());

    gtag('config', 'G-5SBJC04YFB');
</script>

<head>
    <meta charset="UTF-8">
    <title>SigLens</title>

    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <link rel="apple-touch-icon" sizes="180x180" href="./assets/apple-touch-icon.png">
    <link rel="icon" type="image/png" sizes="32x32" href="./assets/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="./assets/favicon-16x16.png">
    <link rel="manifest" href="./assets/site.webmanifest">
    <link rel="mask-icon" href="./assets/safari-pinned-tab.svg" color="#5bbad5">
    <meta name="msapplication-TileColor" content="#da532c">

    <link rel="stylesheet" href="./css/lib/bootstrap.min.css" />
    <link rel="stylesheet" href="./css/lib/all.min.css" />
    <link rel="stylesheet" href="./css/lib/ag-grid.min.css" />
    <link rel="stylesheet" href="./css/siglens.css?cb={{ AppVersion }}" />

    <script src="./js/lib/lodash.min.js"></script>
    <script src="./js/lib/jquery-3.6.0.min.js"></script>
    <script src="./js/lib/jquery-ui.min.js"></script>
    <script src="./js/lib/js.cookie.min.js"></script>
    <script src="./js/lib/moment.min.js"></script>
    <script src="./js/lib/date_fns.min.js"></script>
    <script src="./js/lib/popper.min.js"></script>
    <script src="./js/lib/bootstrap.bundle.min.js"></script>
    <script src="./js/lib/ag-grid-community.min.noStyle.js"></script>
    <script>
        var defaultTheme = Cookies.get('theme') || 'light';
        $('html').attr('data-theme', defaultTheme);
    </script>
    {{ .RunCheck1 | safeHTML }}
</head>

<body>
    <div id="app-container">
        <div id="app-side-nav">
        </div>

        <div class="myOrg">
            <div class="myOrg-container">
                <div class="org-nav-tab">
                    {{ .Button1 | safeHTML }}
                </div>

                <div class="myOrg-inner-container">
                    <div class="org-settings">
                        <div id="api-keys-headings">
                            <p class="caption">Personalize your organization's settings</p>
                        </div>
                        <div class="settings-card pt-1 pb-3">
                            <table class="org-settings-table mt-2" id="org-settings-table">
                                <tr>
                                    <th>Organization Name</th>
                                    {{ if .OrgSettingsOrgName }}
                                        {{ .OrgSettingsOrgName | safeHTML }}
                                    {{ else }}
                                        <td id="orgName">SigLens</td>
                                    {{ end }}
                                </tr>
                                <tr>
                                    {{ if .OrgSettingsRetentionPeriod }}
                                        {{ .OrgSettingsRetentionPeriod | safeHTML }}
                                    {{ else }}
                                        <th>Retention</th>
                                        <td id="retention-days-value">4 days</td>
                                    {{ end }}
                                </tr>
                                <tr>
                                    <th>Deployment Type</th>
                                    {{ if .OrgDeploymentType }}
                                        {{ .OrgDeploymentType | safeHTML }}
                                    {{ else }}
                                        <td id="deployment-type">Single Node Deployment</td>
                                    {{ end }}
                                </tr>
                            </table>
                        </div>
                        {{ if .DistNodesExtras }}
                            {{ .DistNodesExtras | safeHTML }}
                        {{ else}}
                        <div class="settings-card pt-4 pb-3">
                            <div class="header mb-3">
                                System Configuration
                            </div>
                            <table class="org-settings-table" id="system-info-table"></table>
                        </div>
                        {{ end }}
                        <div class="settings-card pt-2 pb-3">
                            <table class="org-settings-table mt-2" id="org-settings-table">
                                <tr>
                                    <th>
                                        <div>
                                            <div>Query Timeout</div>
                                            <div style="font-weight: 100; font-size: 12px;">
                                                <p class="mb-0">
                                                    Set the maximum duration a query can
                                                </p>
                                                <p class="mb-0">run before automatic cancellation. Range: 1-30 minutes.</p>
                                            </div>
                                        </div>
                                    </th>
                                    <th>
                                        <div class="d-flex align-items-center">
                                            <input type="number" id="queryTimeout" min="1" max="30" class="form-control" style="width: 70px;">
                                            <span style="margin-left: 8px; font-weight: 100;">minutes</span>
                                            <button id="saveTimeout" class="btn btn-primary" style="display: none; margin-left: 10px; ">Save
                                            </button>
                                        </div>
                                    </th>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    <div id="app-footer">
        2024 &copy; SigLens
    </div>
    </div>
    <script src="./js/navbar.js?cb={{ AppVersion }}"></script>
    <script src="./js/common.js?cb={{ AppVersion }}"></script>
    <script src="./js/event-handlers.js?cb={{ AppVersion }}"></script>
    <script src="./js/date-picker.js?cb={{ AppVersion }}"></script>
    <script src="./component/upper-navbar/upper-navbar.js?cb={{ AppVersion }}"></script>
    <script src="./js/settings.js?cb={{ AppVersion }}"></script>    

    {{ .RunCheck2 | safeHTML }}
    {{ .RunCheck3 | safeHTML }}

</body>

</html>
